package com.eric.windows.annotations;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import org.androidannotations.annotations.EReceiver;
import org.androidannotations.annotations.ReceiverAction;

/**
 * <h3>Description</h3>
 * TODO
 * <h3>Author</h3> Eric
 * <h3>Date</h3> 2017/8/6 16:34
 * <h3>Copyright</h3> Copyright (c)2017 Shenzhen TLIT  Co., Ltd. Inc. All rights reserved.
 */
public  /**
 * 自定义一个服务
 */
@EReceiver
class MyReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction().equals("com.eric.windows.ConfigurationTestActivity")){
        }
    }

    /**
     * 使用ReceiverAction 注册的方法将会被在onReceive 中调用，如：
     * if (ACTION_MY_SIMPLE_ACTION.equals(action)) {
         MyReceiver_.this.mySimpleAction(intent);
        return ;
       }
     *
     * @param intent
     */
//    @ReceiverAction("com.eric.windows.update")
//    void mySimpleAction(Intent intent,Context context) {
//        Toast.makeText(context, intent.getStringExtra("intent_data"), Toast.LENGTH_SHORT).show();
//    }
//
//    @ReceiverAction
//    void myAction(@ReceiverAction.Extra String valueString, Context context) {
//        // ...
//    }
//
//    @ReceiverAction
//    void anotherAction(@ReceiverAction.Extra("specialExtraName") String valueString, @ReceiverAction.Extra long valueLong) {
//        // ...
//    }


}
